<?php $this->context->layout = 'fullout'; ?>
<div style="display: flex">
    <?=$this->params['leftHtml']?>
    <div  style="width: 89.7%">
        <div class="ui-layout-center">
            <div class="container-div">
                <div class="row">
                    <div class="col-sm-12 search-collapse">
                        <form id="role-form">
                            <input type="hidden" name="structId" id="structId" value="">
                            <div class="select-list">
                                <ul>
                                    <li><?= \common\widgets\FormInput::widget(['name'=>'select|状态','extend'=>['name'=>'where[status]','value'=>'','place'=>'所有','data'=>$this->params['pay_status']]])?></li>
                                    <li>
                                        <?= $this->render('/iframe',['name'=>'searchbtn|搜索'])?>
                                        <?= $this->render('/iframe',['name'=>'resetbtn|重置'])?>
                                    </li>
                                </ul>
                            </div>
                        </form>
                    </div>
                    <div class="col-sm-12 select-table table-striped">
                        <table id="bootstrap-table"></table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<?php $this->beginBlock('script'); ?>
<script>
    var pay_status = eval('<?=json_encode($this->params['pay_status'])?>')
    getUserList();
    function getUserList() {
        bootUrl.url = "<?=\yii\helpers\Url::toRoute('enter')?>"
        var options = {
            modalName: "活动分类",
            sortName:'create_time',
            sortOrder: "desc",
            columns: [
                {field: 'id', title: 'ID', align: 'center', sortable: true,visible: false},
                {field: 'orderid', align: 'center', title: '订单号'},
                {field: 'user', align: 'center', title: '微信用户'},
                {field: 'act_info', align: 'center', title: '活动信息'},
                {
                    field: 'start_time',
                    align: 'center',
                    title: '活动时间',
                    formatter: function (value, row, index) {
                        return value+' ~ '+row.end_time;
                    }
                },
                {
                    field: 'amount',
                    align: 'center',
                    title: '金额',
                    formatter: function (value, row, index) {
                        var html = `<div>金额：${value}</div>`;
                        html += `<div>优惠金额：${row.discount_amount}</div>`;
                        html += `<div>支付金额：${row.pay_amount}</div>`;

                        return html;
                    }
                },
                {field: 'num', align: 'center', title: '数量'},
                {
                    title: '状态',
                    field: 'status',
                    align: 'center',
                    formatter: function (value, row, index) {
                        return $.view.statusShow(row,false,pay_status);
                    }
                },
                {field: 'create_time', title: '报名时间', align: 'center', sortable: true},
                {field: 'callback_time', title: '支付时间', align: 'center', sortable: true},
            ],
        };
        $.table.init(options);
    }
</script>
<?php $this->endBlock(); ?>

